#include "glare.gles2.GpuResourceFactory.h"
#include "glare.gles2.GpuBuffer.h"
#include "glare.gles2.Driver.h"
#include "glare.gles2.Texture.h"
#include "glare.gles2.ShaderResourceView.h"

namespace Glare {

	GLES2GpuResourceFactory::GLES2GpuResourceFactory(GLES2Driver* driver)
		: _driver(driver)
	{
	}

	GpuBuffer* GLES2GpuResourceFactory::CreateBuffer(const GpuBufferDescription& description)
	{
		return new GLES2GpuBuffer(this, description);
	}

	Texture* GLES2GpuResourceFactory::CreateTexture(const TextureDescription& description)
	{
		return new GLES2Texture(this, description);
	}

	ShaderResourceView* GLES2GpuResourceFactory::CreateShaderResourceView(GpuResource* resource, const ShaderResourceViewDescription& description)
	{
		GLES2GpuResourceInterface* gles2_interface = static_cast<GLES2GpuResourceInterface*>(resource->_GetInterface());
		return new GLES2ShaderResourceView(this, gles2_interface, description);
	}

	Driver* GLES2GpuResourceFactory::GetDriver() const
	{
		return _driver;
	}
}
